module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            scripts: {
                files: ['./src/js/*.js'],
                tasks: ['webpack']
            }
        },
        webpack: {
            react: {
                entry: './src/js/entry',
                output: {
                    path: __dirname + '/public/js',
                    filename: 'bundle.js'
                },
                module: {
                    loaders: [
                        { test: /\.jsx?$/, loaders: ['jsx?harmony'] }
                    ]
                },
                externals: {
                    'React': 'React',
                    'ReactDOM': 'ReactDOM'
                }
            }
        }
    });



    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-webpack');


    grunt.registerTask('default', ['webpack']);
}